<template>
    <ul class="yyyy">
        <li v-for="(item, index) in arr" :key="index">

            <img :src="item.image" alt="">
            <div class="ccc">
                <p class="p1">{{ item.name }}</p>
                <p class="p2" v-show="item.description">{{ item.description }}</p>
                <p class="p3">月售{{item.sellCount}}份<span>好评率{{item.rating}}%</span></p>
                <p class="p4">￥{{item.price}}<span><del v-show="item.oldPrice">{{item.oldPrice}}</del></span></p>
                <div>
                    <img src="../../../img/jian.png" alt="" v-show="false">
                    <p v-show="false">0</p>
                    <img src="../../../img/jia.png" alt="" @click="dianji(arr,index)">
                </div>
                
            </div>
        </li>
    </ul>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return {
            arr: [ ],
            show: true,
            
        }
    },
    methods: {
        async msg1() {
            const data = await axios.get("http://localhost:3006/")
            this.arr = [...data.data.data[0].goods[0].foods]
            // console.log(this.arr)
        },
        dianji(state,payload){
            console.log(111);
        }
    },
    created() {
        this.msg1()
        // console.log(arr1)
    },
}
</script>

<style>
* {
    margin: 0;
    padding: 0;
}

.yyyy {
    display: flex;
    flex-direction: column;
    /* height: 113vw;
    overflow: scroll; */
}

.yyyy img {
    width: 70px;
    height: 70px;
}

.yyyy>li {
    display: flex;
    margin: 10px 0px;
    /* background-color: aqua; */
    position: relative;
}
.ccc>.p1{
    font-size: 3.733vw;
    line-height: 2.667vw;
    color: rgb(7, 17, 27);
}
.ccc>.p2{
    font-size: 2.667vw;
    color: rgb(147, 153, 159);
    line-height: 2.667vw;
    margin-top: 2vw;
    
}
.ccc>.p3{
    font-size: 2.667vw;
    color: rgb(147, 153, 159);
    line-height: 1.667vw;
    margin-top: 2vw;
}
.ccc>.p3>span{
    margin-left: 2.333vw;
}
.ccc>.p4{
    font-size: 3.733vw;
    color: red;
    font-weight: bold;
    line-height: 7.667vw;
    
}
.ccc>.p4>span{
    color: rgb(147, 153, 159);
}
.ccc{
    margin-left: 3.667vw;
    
}
/* .ccc>.p4::after{
    content: '+';
    color: skyblue;
    position: absolute;
    right: 4vw;
    font-size: 4.667vw;
    border: 1px solid skyblue;
    padding: 0px 2.333vw;
    border-radius: 50%;
} */
.ccc>div{
    width: 5.333vw;
    height: 5.333vw;
    position: absolute;
    top: 12.333vw;
    right: 4vw;
    display: flex;
    /* background-color: darkkhaki; */
}
.ccc>div>img{
    width: 5.333vw;
    height: 5.333vw;
}
.ccc>div>p{
    
    margin: 0px 3.533vw;
}
</style>